#include <iostream>
#include <cstring>
#include "SharedMemory.hpp"
#include "Fifo.hpp"
#include "Time.hpp"

int main()
{
    cout << "time: " << GetCurrTime() << endl;
    shm.CreateShm();
    shm.AttachShm();
    gpipe.OpenPipeForRead();
    // 在这里进行 IPC
    struct data *image = (struct data *)shm.GetAddr();
    // printf("client 的虚拟地址： %p\n", strinfo);

    while (true)
    {
        // 先等待写了，再读
        gpipe.Wait();

        printf("status: %s\n", image->status);
        printf("lasttime: %s\n", image->lasttime);
        printf("image: %s\n", image->image);
        strcpy(image->status, "过期");
    }
 

    shm.DetachShm();
    shm.DeleteShm();
    return 0;
}